<template>
  <el-dialog title="已选学生" :visible.sync="showStudentResultList">
    <el-table :data="studentResultList">
      <el-table-column label="序号" type="index" />
      <el-table-column label="用户名" align="center" prop="nickname" />
      <el-table-column label="手机号" align="center" prop="mobile">
        <template slot-scope="scope">{{
          scope.row.mobile | decodeMobile
        }}</template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="mobile">
        <template slot-scope="scope">{{
          moment(scope.row.createTime).format('yyyy-MM-DD HH:mm:ss')
        }}</template>

      </el-table-column>
    </el-table>
  </el-dialog>
</template>
<script>
import { getCompanyListByIds } from '@/api/company-admin-api/userManage/index.js'
import moment from 'moment'
export default {
  name: 'StudentResultDialog',
  components: {},
  data() {
    return {
      moment,
      studentResultList: [],
      showStudentResultList: false
    }
  },
  methods: {
    open(ids) {
      console.log('idsids>', ids)
      const selectIds = ids.map(id => Number(id))
      const params = {
        pageNo: 1,
        pageSize: 9999
      }
      getCompanyListByIds(params).then(res => {
        if (res && res.code === 0) {
          this.studentResultList = res.data.list.filter(item => {
            return selectIds.indexOf(Number(item.id)) > -1
          })
          this.showStudentResultList = true
        }
      })
    }
  }
}
</script>

